package parser

import (
	"distributed/message"
	"distributed/parser/hackpai"
	"distributed/parser/net163"
)

const (
	HackRecent       = "HackRecent"
	Net163HomeHead   = "Net163HomeHead"
	Net163WarParser  = "Net163WarParser"
	CommentApiParser = "CommentApiParser"
	HotPageParser    = "HotPageParser"
	SongIDParser     = "SongIDParser"
	SongDetailParser = "SongDetailParser"
)

func GetFunction(function string) func(input string) (result *message.ReptileResp) {
	switch function {
	case HackRecent:
		return hackpai.Parser
	case Net163HomeHead:
		return net163.HomeParser
	case Net163WarParser:
		return net163.WarParser
	case CommentApiParser:
		return net163.CommentApiParser
	case HotPageParser:
		return net163.HotPageParser
	case SongIDParser:
		return net163.SongIDParser
	case SongDetailParser:
		return net163.SongDetailParser
	default:
		return func(input string) (result *message.ReptileResp) {
			return nil
		}
	}
}
